<template>
  <div class="suspense">
    <h1>这里介绍了suspense</h1>
    <Suspense>
      <template v-slot:default>
        <Child />
      </template>
      <template v-slot:fallback>
        <h3>加载中.......</h3>
      </template>
    </Suspense>
  </div>
</template>
<script lang="ts" setup>
import { defineAsyncComponent, Suspense } from "vue";
const Child = defineAsyncComponent(() => import("./child.vue"));
</script>
<style scoped>
.suspense {
  width: 80vw;
  height: 80vh;
  border: 1px solid red;
}
</style>